package com.hk.kindheartedness;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;

import com.hk.kindheartedness.db.DBOpenHelper;

/**
 * 医生挂号设置与查看业务
 */
public class DoctorRegistrationActivity extends AppCompatActivity implements View.OnClickListener {

    //    Initialize Toast
    private Toast toast;

    //    Initialize intent
    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_doctor_registration);
//        获取按钮控制权
        Button registrationAddBtn = findViewById(R.id.registrationAddBtn);
        Button registrationLogBtn = findViewById(R.id.registrationLogBtn);
        Button findRegistrationBtn = findViewById(R.id.findRegistrationBtn);
//        添加点击事件
        registrationAddBtn.setOnClickListener(this);
        registrationLogBtn.setOnClickListener(this);
        findRegistrationBtn.setOnClickListener(this);

        /*Intent intent2 = getIntent();
        Bundle bundle = intent2.getExtras();
        String loginDoctorId = bundle.getString("loginDoctorId");
        Log.i("当前登录医生ID：", loginDoctorId);*/


    }

    /**
     * 按钮点击事件
     *
     * @param v
     */
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
//            跳转到指定的挂号日期设置Activity
            case R.id.registrationAddBtn:
                intent = new Intent(DoctorRegistrationActivity.this, RegistrationSettingActivity.class);
                Intent intent2 = getIntent();
                Bundle bundle = intent2.getExtras();
                intent.putExtras(bundle);
                startActivity(intent);
                break;
//                跳转到患者预约记录
            case R.id.registrationLogBtn:
                intent = new Intent(DoctorRegistrationActivity.this, RegistrationLogActivity.class);
                Intent intent3 = getIntent();
                Bundle bundle2 = intent3.getExtras();
                intent.putExtras(bundle2);
                startActivity(intent);
                break;
//                跳转到挂号记录
            case R.id.findRegistrationBtn:
                intent = new Intent(DoctorRegistrationActivity.this, QueryRegistrationActivity.class);
                Intent intent4 = getIntent();
                Bundle bundle3 = intent4.getExtras();
                intent.putExtras(bundle3);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}